package server

import (
	"github.com/go-kratos/kratos/v2/log"
	"github.com/hibiken/asynq"
)

type asynqLogger struct {
	logger *log.Helper
}

func NewLogger(logger log.Logger) asynq.Logger {
	return &asynqLogger{
		logger: log.NewHelper(logger),
	}
}

func (l asynqLogger) Debug(args ...interface{}) {
	l.logger.Debug(args)
}

func (l asynqLogger) Info(args ...interface{}) {
	l.logger.Info(args)
}

func (l asynqLogger) Warn(args ...interface{}) {
	l.logger.Warn(args)
}

func (l asynqLogger) Error(args ...interface{}) {
	l.logger.Error(args)
}

func (l asynqLogger) Fatal(args ...interface{}) {
	l.logger.Fatal(args)
}
